<template>
  <div class="header">
    <div class="header-left">
      <span class="iconfont">&#xe679;</span>
    </div>
    <div class="header-search">
      <span class="iconfont">&#xe65c;</span>
      <input class="header-input" type="text" placeholder="输入城市/景点/游玩主题">
    </div>
    <router-link class="header-right" to="/city">
      {{ this.city }}
      <span class="iconfont">&#xe79b;</span>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl'
@import '~styles/mixins.styl'
  .header
    display: flex
    line-height: .86rem
    background-color: $bgColor
    color: #fff
    .header-left
      float: left
      width: .64rem
      span
        text-align: center
        font-size: .36rem
        margin-left: .05rem
    .header-search
      flex: 1
      background-color: #fff
      border-radius: .1rem
      height: .64rem
      margin-top: .12rem
      color: #ccc
      line-height: .64rem
      padding-left: .1rem
      .header-input
        width: 90%
        height: .52rem
        margin-top: -.1rem
    .header-right
      width: 1.24rem
      float: right
      text-align: center
      color: #fff
      ellipsis()
</style>
